import { Module } from "@nestjs/common";
import { EventEmitterModule } from "@nestjs/event-emitter";
import { ScheduleModule } from "@nestjs/schedule";
import { TypeOrmModule } from "@nestjs/typeorm";
import { AppController } from "./app.controller";
import { AppService } from "./app.service";
import { AuthModule } from "./auth/auth.module";
import { configService } from "./config/config.service";
import { TerminusModule } from "@nestjs/terminus";
import { HealthController } from "./health.controller";
import { CommentModule } from "./comment/comment.module";
import { GroupModule } from "./group/group.module";
import { ModuleModule } from "./module/module.module";
import { ObjectiveModule } from "./objective/objective.module";
import { ProductModule } from "./product/product.module";
import { TaskModule } from "./task/task.module";
import { UserModule } from "./user/user.module";
import {Oauth2Controller} from "./oauth2.controller";

@Module({
  imports: [
    EventEmitterModule.forRoot(),
    ScheduleModule.forRoot(),
    TypeOrmModule.forRoot(configService.getTypeOrmConfig()),
    TerminusModule,
    AuthModule,
    CommentModule,
    GroupModule,
    ModuleModule,
    ObjectiveModule,
    ProductModule,
    TaskModule,
    UserModule,
  ],
  controllers: [AppController, HealthController, Oauth2Controller],
  providers: [AppService],
})
export class AppRootModule {}
